The invention relates to system control methods, and in particular to memory disposition methods and systems for a system with a control unit.
An embedded system generally comprises a combination of hardware and software, either fixed or programmable. Embedded systems are generally designed for specific application devices, such as mobile phones or personal digital assistants (PDAs). Thus, components of an embedded system are distinguished from a common computer system. For example, memory devices in an embedded system of an application device, such as a mobile phone, may be designed with limited size due to hardware limitations of the application device.
Conventionally, an embedded system has a control unit, such as a micro control unit (MCU), for system control and a memory device, such as a flash memory, for program storage. A collection of software programs is controlled by the control unit and stored in the memory device. If software programs are modified, they must be compiled, linked, and reloaded in the system, even though the modification may be minor.
FIG. 1 is a flowchart of an embodiment of a conventional software program control method. In the example, an embedded system has a control unit for software program control and a flash memory for software program storage. Software programs are modified (step S100). The software programs are compiled, and the relative addresses of the symbols (functions/data/variables) in the software programs are determined at compile time (step S102). The symbols are then linked to absolute addresses, which will not be changed at runtime (step S104). The modified software programs are reloaded in the flash memory (step S106).
FIG. 2 is a diagram of an embodiment of a conventional software program control system. The software program control system is employed in an embedded system with a control unit 204. For example, an embedded system with a MCU may be employed in a mobile phone for communication. A memory device 202 is provided and coupled to the control unit 204. The memory device 202, a flash memory, is a non-volatile memory and allowed to be programmed for multiple times. The memory device 202 is used for storing software programs. Furthermore, a random-access-memory (RAM) 206, which is a volatile memory, is provided to store run-time data. For the conventional embedded system, all software programs are stored in the flash memory 202, requiring large memory size. The cost of a multiple-time programmable memory device, such as a flash memory, is much higher than a one-time programmable memory device, such as read-only-memory (ROM). However, if whole software programs are stored in the ROM, it will not be flexible if some defects need to be fixed. Additionally, memory sizes are limited for most embedded systems. Thus, cost-reduced memory disposition methods and systems for an embedded system are desirable.